<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>${auction.sn} ${auction.goodsname}</title>
<#include "top.html">
<script type="text/javascript" src="${base}/res/front/js/mobile.js"></script>
<script type="text/javascript">
function setDate(inputObj){
	var calenderObj = document.createElement("span");
	calenderObj.innerHTML = HS_calender(new Date());
	calenderObj.style.position = "absolute";
	calenderObj.targetObj = inputObj;
	inputObj.parentNode.insertBefore(calenderObj,inputObj.nextSibling);
}
function parseAutoError(dataobj)
	{
		if(dataobj.datastatus=='success')
		{
			alert('设置成功');
			$('#to_cancel').show();	
			$('#_autoSet').hide();
			$('#_autoTip').show();	
			var $str ="";
			if 	($("#autoType").val()==1){
				$str = "→价格为"+$('#autoPrice').val()+"元时启动<br/>→10秒内随机出价<br/>→预计出价"+$("#xib_count").val()+"次。";
			}
			if($("#autoType").val()==3){
				$str = "→时间为"+$('#autoTime').val()+"时启动<br/>→10秒内随机出价<br/>→预计出价"+$("#xib_count").val()+"次。";
			}	
			$('#_autoTipMsg').html($str);				
			Dialog_close();
		}
		else if(dataobj.datastatus=='nogoods')
		{
			alert('此商品不能启动自动出价器');
		}
		else if(dataobj.datastatus=='nomoney')
		{
			alert('乐豆不足,当前您的乐豆为'+dataobj.money+',所需乐豆为：'+dataobj.needmoney);
		}
		else if(dataobj.datastatus=='nologin')
		{
			Login_Dialog();
		}
		else if(dataobj.datastatus=='nocount')
		{
			alert('未设置次数');
		}
		else if(dataobj.datastatus=='notime')
		{
			alert('请选择一个时间');
		}
		else if(dataobj.datastatus=='nomobile')
		{
			alert('您还未通过手机验证，无法参与竞拍！');
		}
		else if(dataobj.datastatus=='isshut')
		{
			alert('设置失败');
		}
		else if(dataobj.datastatus=='islimit')
		{
			alert('此商品是限次竞拍,限制次数为'+dataobj.number);
		}
		else if(dataobj.datastatus=='failed')
		{
			alert('设置失败,不能重复设置');
		}else if(dataobj.datastatus=='limitbuy')
		{
			alert('您已超出限拍件数');
		}else if(dataobj.datastatus=='iprepeate')
		{
			alert('注意啊，同一IP只允许一个用户参与同一商品竞拍！');
		}
	}

	//出价 1.保存出价信息 2.查询出价历史
	function setDetailInfo(){	
		setInfo('${auction.id}','',"btn_setInfo");
		getBuyLog('${auction.id}','ajax',true,'price');
		getMyBuyLog('','${auction.id}','ajax',true,'price');
	}
	function resetcode(){
		var i=parseInt(10*Math.random()); 
		var url='http://www.51lpk.com/models/showimgcode.php?random='+i;
		$('#validatecode').attr('src',url);		
	}
	$(function(){
		var $autoType = $("#autoType");		
		$autoType.change(function(){	
			if($autoType.val()==1){//价格
				$('#_time').hide();
				$('#_price').show();				
			}
			else if ($autoType.val()==2){//守秒暂不开放
				$('#sel_ftime').show();
				$('#autoPrice').hide();
			}
			else if ($autoType.val()==3){//时间
				$('#_time').show();
				$('#_price').hide();				
			}			
		});	
		$("#autoTime").click(function(){
			setDate(document.getElementById('autoTime'));
			$("#autoTime").focus();
		});
		$("#to_start").click(function(){
			if($autoType.val()==1 && $('#autoPrice').val()==''){//价格
				alert("启动价格不能为空！");
				return ;
			}
			if ($autoType.val()==3 && $("#autoTime").val()==''){//时间
				alert("启动时间不能为空！");
				return ;
			}
			document.autoBuyForm.submit();					
		});	
		$("#to_cancel").click(function(){
			$('#_autoTip').hide();
			$('#_autoSet').show();	
			AutoBuy_Close('${auction.id}');
		});			
	});

		function showbigimg(obj,thumbsrc)
		{
			$('#big_pic img').attr('src',thumbsrc);
			$('#small_pic_ol img').removeClass('small_pic_selected');
			$('#small_pic_ol img').addClass('small_pic_noselected');
			$('#t_'+obj).addClass('small_pic_selected');
		}
		function showpro(selected,total){
			for(var i=1;i<=total;i++){
				$('#yugao_'+i).css("display","none");
				if(i==selected){
					$('#yugao_'+i).css("display","");
				}
			}
		}
		
</script>
<div id="main" class="main">
	<div class="H_Space"></div>
	<div id="Pro_info" >
		<div id="pro_img">
			<div id="big_pic">
			<#list accessoryList as list>
			<img style="width:300px;height:300px" src="${saveImagUrl}${list.thumbnail}" border="0" alt=""/>
			<#break>
			</#list>
			</div>
			<div class="pro_line"></div>
			<div id="small_pic_father">
				<ol id="small_pic_ol">
						<#list accessoryList as list>
						<li class="small_pic_li" >
							<img id="t_${list_index}" class=<#if list_index==0>"small_pic_selected"<#else>"small_pic_noselected"</#if> src="${saveImagUrl}${list.thumbnail}"  onmousemove="showbigimg(${list_index},'${saveImagUrl}${list.path}');"  border="0" alt=""/>
						</li>
						<#if list_index==2>
						<#break>
						</#if>
						</#list>
				</ol>
			</div>
		</div>

		<div id="pro_mess">
			<div class="pro_title">${auction.goodsname}&nbsp;&nbsp;<span style="font-size:12px; color:#b41a0d;">${auction.sn!""}</span></div>
			<div class="pro_type">
				<img src="${base}/res/front/images/bu.gif" style="float:left;width:19px;height:19px;"/>&nbsp;若竞拍未成功，可以按补差购买价格进行购买此商品。
			</div>
			<div class="pro_other">
				<ol class="pro_o_l">
					<li>乐拍时段：全天</li>
					<li>市 场 价：<span class="price_small">￥${auction.goodsprice}</span></li>
					<li>当前价格：<span class="pric_big">￥<font id="nowprice_${auction.id}">-.-</font></span></li>
				</ol>
				<ol class="pro_o_l">
					<li>开始时间：${auction.starttime}</li>
					<li>物流费：<span class="price_small">￥</span></li>
					<li>出价人：<span class="price_user"><span class=" blue" style="height:23px;line-height:23px;padding-left:5px;" id="currentuser_${auction.id}">--</span></span></li>
				</ol>
			</div>
			<div id="pro_time">
				<div class='pro_last_time'>
					<div class="pro_time_txt"><img src="${base}/res/front/images/product/cion.jpg" />&nbsp;剩余时间</div>
					<div id="pro_time_num"><strong class="black" style="font-size:35px;font-family:Arial;" id="lasttime_${auction.id}">--:--:--</strong><strong class="black" id="ms_${auction.id}"></strong></div>
				</div>				
				<div id="price_button">
					<#if loginMember??>
				        <!--1.可以竞拍开始-->
				        <input type="image" id="btn_setInfo" style="cursor: pointer;" onclick="setDetailInfo()" src="${base}/res/front/images/product/pricebutton.jpg" />
					 <#else>
					  	<!--2.未登录开始-->
					    <img onclick="Login_Dialog()" style="cursor: pointer;" src="${base}/res/front/images/product/pricebutton.jpg" />
				        <!--未登录结束-->
					</#if>
					<div class="bid_prompt" id="bidtips_${auction.id}" style="display:none;"></div>
				</div>
			</div>
			<div class="order_des">
			 每次出价&nbsp;->消耗<strong class='red'>${auction.usebeat}</strong>粒乐豆 ->当前价增加<strong class='red'>${auction.addprice}</strong>元     
			 <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ->倒数计时器回归至10秒 
			 <br/>倒计时为0->成交
			 <br/>支付限制&nbsp;->竞拍订单7天，补差价订单3天
			 <!--			 <br/>直接购买&nbsp;-><span class="price_small">￥5299.00</span>&nbsp;&nbsp;&nbsp;&nbsp; <a  class="pric_big" href="http://www.51lpk.com/con-user/act-login.html"><img src="http://www.51lpk.com/views/leke/i/product/dot01.jpg" /> 马上购买</a>
 			 			-->
 			</div>

		</div>

		<div id="page_right">
			<div id="pro_user">
				<div class="user_lable_f">
					<div class="my_jp" id="my_jp" onmouseover="show('myjp')">我的竞拍</div>
					<div class="jp_history" id="jp_history" onmouseover="show('history')">竞拍历史</div>
				</div>
				<div id="page_right_father">
					<#if loginMember??>	
					<div id="my_jp_con">
						<div class="user_nologin_con">
							<span id='lpk_tips'>乐拍客是一家娱乐竞拍购物网站，以独特新颖的购物模式，使大家在购买商品之前有一次能够以较低价格羸得商品的机会。<a href="http://www.51lpk.com/con-article/act-help/id-61.html" target='_blank' class="link_blue">点击了解更多</a></span>
							<table cellspacing="0" cellpadding="0" border="0" style="line-height:20px;width:90%;" >											
								<tbody id="countLog_${auction.id}"></tbody>
							</table>
						</div>
						<iframe src="" style="display:none;" name="smstime"></iframe>
						<FORM name="autoBuyForm" method="POST" action="http://www.51lpk.com/index.php" target="smstime">
						<div id="_autoSet" style="display:">
						<input type="hidden" name="commit" value="1" />
						<input type="hidden" name="act" value="autobuy" />
						<input type="hidden" name="con" value="index" />
						<input type="hidden" name="ip" value="" />
						<input type="hidden" value="${auction.id}" name="goodsid">
						<div class="user_nologin_title"><label class="titlelable">自动出价器</label><label class="what_text">
						<a title="如何使用自动出价器" target="_blank" href="#">自动出价器是什么？</a></label></div>
						<div class="user_nologin_line"></div>
						<div class="user_nologin_con">
							<ol class="userlogin_cjq">
								<li class="userlogin_cjq_li">
								执行方式：最后10秒随机出价
								</li>
								<li>
								启动条件：<select class="" id="autoType" name="autoType" style="width:55px;">
										    <option value="1">价格</option>
										    <option value="3">时间</option>
										  </select>										
									<span id="_price"><input type="text" style="width:50px;" id="autoPrice" name="autoPrice" class="n_textbox" value=""/>元</span>
									<span id="_time" style="display:none"><input type="text" style="width:110px;" id="autoTime" name="autoTime" class="n_textbox" value="" /></span>
								</li>
								<li>
								出价次数：<input type="text" style="width:50px;" id="xib_count" name="auto_count" class="n_textbox" value="1"/>&nbsp;次     
								</li>
							</ol>
						</div>
						<div style="cursor: pointer;" class="user_nologin_title" id="to_start">
							<div class="qdcjq1"><img src="http://www.51lpk.com/views/leke/i/product/dot01.jpg" /></div>
							<div class="qdcjq2">&nbsp;启动出价器</div>
						</div>						
						</div>
						<div id="_autoTip" style="display:none" >
									<div class="user_nologin_title">
										<label class="titlelable">自动出价器</label>
										<label class="what_text">
											<a title="如何使用自动出价器" target="_blank" href="http://www.51lpk.com/con-article/act-help/id-81.html">自动出价器是什么？</a>
										</label>
									</div>
									<div class="user_nologin_line"></div>
									<div class="user_nologin_con">
									<ol class="userlogin_cjq">
										<li id='_autoTipMsg' class="userlogin_cjq_li">
												→价格为0.00元时启动<br/>→10秒内随机出价<br/>→预计出价次。				
										</li>								
									</ol>
									</div>			
									<div style="cursor: pointer;" class="user_nologin_title" id="to_cancel">
										<div class="qdcjq1"><img src="${base}/res/front/images/product/dot01.jpg" /></div>
										<div class="qdcjq2">&nbsp;关闭出价器</div>
									</div>	
							</div>						
						</FORM>
					</div>
					<#else>
					<div id="my_jp_con">
						<div class="user_nologin_title">免费注册，参与竞拍</div>
						<div class="user_nologin_line"></div>
						<div class="user_nologin_con">参与竞拍，需要花费乐豆，每个乐豆价值1元钱</div>
						<div class="user_nologin_title">竞拍成功</div>
						<div class="user_nologin_line"></div>
						<div class="user_nologin_con">
						当倒计时结束时，无他人竞价，您将胜出，以成交价购得此期商品。
						</div>
						<div class="user_nologin_title">竞拍失败</div>
						<div class="user_nologin_line"></div>
						<div class="user_nologin_con">
						花费的乐豆可以抵当等值的价钱用于购买当期商品，相当于全价购买，跟平常购物一样。
						</div>
					</div>
					</#if>				
					<div id="jp_history_con" style="display:none">
					<table class="history_table">
					  <tr class="history_tr">
						<td class="tabletitle" width="35%">出价人</td>
						<td class="tabletitle"  width="15%">价格</td>
						<td class="tabletitle"  width="50%">IP地址</td>
					  </tr>
					<#list 0..9 as list>
					<tr id='salelog_${list_index}' style='display:none;height:1px;'><td><span id='user_${list_index}'  class="blue"></span></td><td><span id='price_${list_index}'></span></td><td ><span id='ip_${list_index}'></span></td></tr>
					<tr id='line_${list_index}' style='display:none;' height="1"><td colspan="3" background="${base}/res/front/images/product/dot02.jpg"></td></tr>
					</#list>
					</table>
					</div>
				</div>
			</div>
			<div class="pro_space"></div>
			<div id="pro_yugao">
				<div id="yugao_title">
					<div id="yugao_title_txt"><img src="${base}/res/front/images/product/dot.jpg" />&nbsp;商品预告</div>
					<div id="yugao_num_roll">
						<ol class="yugao_ol">
						<#list yuGaoList as list>
							<li class="yugaoli" onmouseover="showpro(${list_index+1},${yuGaoList?size});">${list_index+1}</li>
						</#list>
						</ol>
					</div>
				</div>
				<#list yuGaoList as list>
				<div id='yugao_${list_index+1}' style=<#if list_index==0>"display:;"<#else>"display:none;"</#if>>
					<div class="yugao_pro_pic">
						<a href="${base}/auction/detail.htm?id=${list.id}" target="_blank" class="black">
							<img class='yugao_pro_pic_img' src="${saveImagUrl}${list.thumbnail!""}" /></a></div>
					<div class="yugao_pro_tex">
					<a href="${base}/auction/detail.htm?id=${list.id}" target="_blank" class="black">${list.goodsname}</a>
					<br />市场价：<strong class="orage">${list.goodsprice} </strong>元
					<br />热拍时间：<strong style="color:#b41a0d">${list.starttime?string("HH:mm")}</strong>
					</div>
				</div>
				</#list>
			</div>
		</div>
	</div>
	<div id="pdetails">
		<div class="wjst_title">
			<div class="focus_button displayFun" id="tab01" onclick="DisplayFun('tab01')">商品简介</div>
			<div class="common_button displayFun" id="tab03" onclick="DisplayFun('tab03')">商品描述</div>
			<div id="tab04" class="common_button displayFun" onclick="DisplayFun('tab04')">往期竞拍</div>
			<div class="wjst_right_o">惊喜多一点，我要乐拍客！<a href="${base}/auction/now.htm" target="_blank">更多热拍</a></div>
		</div>
		<div class="wjst_line"></div>
		<div id="tab_Father1">
			<div class="pro_detail" id="tab01_c">
			${goods.goodsbrief}
			</div>
			<div class="pro_detail" id="tab03_c" style="display:none">
			${goods.goodsabout}
			</div>
			<div class="pro_detail" id="tab04_c" style="display:none">
				<div id="tab_Father">
					<div id="tab_2_c" style="display:''">
					<#list historyAuctionList! as list>
					<div class="show_complete">
						<div class="userinfo clear">
							<div class="avatar">
								<a href=<#if (list.html!"")?length gt 0>"${base}${list.html}"<#else>"${base}/auction/detail.htm?id=${list.id}"</#if>><img src="" alt="" /></a>				
							</div>
							<div class="info">	
								<div class="price">成交价：<span class='red3'>￥${list.realprice}</span></div>
								<div class="user">赢家：<span class='blue'>${list.auctionuname}</span></div>
								<div class="datetime">成交时间：${list.endtime?string("yyyy-MM-dd")}</div>
							</div>
						</div>
					</div>
					</#list>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
       		<input type="hidden" id="ids" value="${auction.id}" />
			<input type="hidden" id="oids" value="${auction.id}" />
			<script type="text/javascript">
				window.onload=function(){
					var bidManager  = new BidManager();
					bidManager.start();	
					<#if loginMember??>
					getMyBuyLog('','${auction.id}','ajax',false,'bidprice','countLog');
					</#if>
					getBuyLog('${auction.id}','ajax',false,'bidprice');
					bidManager.show_alert();
				}
			</script>
			 <br/>
<#include "foot.html">
</body>

</html>